<template>
    <MdpFuncMenu>
      <template #toolbar="{page}">
        <el-button @click="showMenusToRolesSet(page.sels, true)" :disabled="page.sels.length === 0" icon="setting"
          type="warning">分配到角色</el-button>
      </template>
      <template #oper="{scope}">
        <el-button @click="showMenusToRolesSet([scope.row], false)" icon="menu" title="将该菜单分配给角色" type="warning"/> 
      </template>

      </MdpFuncMenu>
   
  <mdp-dialog ref="menusToRolesSetDialog" title="分配菜单到多个角色" width="80%">
    <template #default="{ visible, data, dialog }"> 
      <menu-role-set ref="menusToRolesSet" :mids="data.mids" :batch="data.batch" :visible="visible"
        @close="dialog.close()" />
    </template>
  </mdp-dialog> 
</template>

<script>

import util from '@/components/mdp-ui/js/util';//全局公共库
import { MdpTableMixin } from '@/components/mdp-ui/mixin/MdpTableMixin.js';
import config from '@/api/mdp_pub/mdp_config';//全局公共库
import * as MenuDefApi from '@/api/mdp/menu/menuDef';
import MenuDefForm from '@/components/mdp-ui-ext/mdp-func-menu/Form.vue';//新增修改明细界面
import { mapState } from 'pinia'
import { useUserStore } from '@/store/modules/user'
import MenuRoleSet from '../menuRole/MenusToRolesSet.vue';//修改界面  
import { listMenuModule } from '@/api/mdp/menu/menuModule';

export default {
  name: 'menuDefMng',  
  components:{
    MenuRoleSet
  },
  methods: { 
    showMenusToRolesSet(sels, batch) {
      this.$refs['menusToRolesSetDialog'].open({ mids: sels.map(k => k.id), batch: batch })
    },
    
  }, 
}

</script>

<style scoped></style>
